﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Medianamik.Globalization;

namespace Medianamik.Core
{
    public class PropertyDefinition
    {
        internal PropertyDefinition(Guid id, Guid dataTypeId)
            :this(id, dataTypeId, null, null, null)
        {
        }

        internal PropertyDefinition(Guid id, Guid dataTypeId, Guid? medianamikControlId, MedianamikControlInfo? medianamikControlInfo, short? maxLength)
        {
            Id = id;
            DataTypeId = dataTypeId;
            MedianamikControlId = medianamikControlId;
            MedianamikControlInfo = medianamikControlInfo;
            MaxLength = maxLength;
        }

        public string LocalizedName
        {
            get { return Translator.Translate("TypeManagement", "PropertyDefinition_" + Id); }
        }

        public Guid Id { get; set; }
        public Guid DataTypeId { get; set; }
        public short? MaxLength { get; set; }
        public Guid? MedianamikControlId { get; set; }
        public MedianamikControlInfo? MedianamikControlInfo { get; set; }
    }
}
